package cz.boxdesign.library.entity.dao;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;

import java.util.List;

import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import cz.boxdesign.library.common.dao.CommonDao;
import cz.boxdesign.library.configuration.AppConfig;
import cz.boxdesign.library.entity.Book;

@Ignore
public class KnihaDaoImplText {

  EntityDao knihaDao;

  @Before
  public void setUp() throws Exception {
    AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(AppConfig.class);
    ctx.scan("cz");
    CommonDao dao = (CommonDao) ctx.getBean("commonDao");
    knihaDao = dao.getDao(Book.class);
  }

  @Test
  public void getAllTest() {
    List<Book> knihaList = knihaDao.getAll();
    assertNotNull(knihaList);
    assertFalse(knihaList.isEmpty());
  }
}
